<%@ page language="java" contentType="text/html; charset=utf-8"
	pageEncoding="utf-8"%>
<%@ include file="/pages/common/header.jsp"%>
<jdf:themeFile file="business/schedule.js" />
</head>
<c:choose>
    <c:when test="${action=='page'}">
        <c:set value="排期表管理" var="title" />
    </c:when>
    <c:when test="${action=='finished'}">
        <c:set value="已完成排期表" var="title" />
    </c:when>
    <c:when test="${action=='my'}">
        <c:set value="排期表查看" var="title" />
    </c:when>
    <c:otherwise>
        <c:set value="排期表" var="title" />
    </c:otherwise>
</c:choose>
<body>
	<div class="contentBody contentborder">
		<div class="tab-pane" id="tabPane">
			<div id="message">${message }</div>
			<div class="tab-page">
				<h1 class="tab">${title }</h1>
				<div class="contentborder">
					<jdf:form bean="request" scope="request">
						<form action="${dynamicDomain}/schedule/${action}" method="post">
							<table class="inputTable">
								<tr>
									<td nowrap class="label cancelBorderLeft">
									   <label for="search_EQI_purchaseId">采购编号：</label></td>
									<td class="content">
									   <input type="text" name="search_EQI_purchaseId" /></td>
									<td nowrap class="label">
									   <label for="search_LIKES_customerPurchaseNo">客人产品编号：</label></td>
									<td class="content">
									   <input type="text" name="search_LIKES_customerPurchaseNo">
									</td>
								</tr>
                                <tr>
                                    <td nowrap class="label cancelBorderLeft">
                                        <label for="search_LIKES_name">中文名称：</label>
                                    </td>
                                    <td class="content">
                                        <input type="text" name="search_LIKES_name">
                                    </td>
                                    <td nowrap class="label cancelBorderLeft">
                                        <label for="search_LIKES_englishName">英文名称：</label>
                                    </td>
                                    <td class="content">
                                        <input type="text" name="search_LIKES_englishName">
                                    </td>
                                </tr>
                                <c:if test="${action!='my' }">
                                <tr>
                                    <td nowrap class="label">
                                        <label for="search_EQI_supplierId">供应商：</label>
                                    </td>
                                    <td class="content" colspan="3">
                                        <input type="hidden" name="search_EQI_supplierId" id="supplierId"/>
                                        <input type="text" name="supplierName" id="supplierName"/>
                                        <a href="${dynamicDomain}/supplier/select?ajax=1" class="colorbox">选择供应商</a>
                                    </td>
                                </tr>
                                </c:if>
								<tr>
									<td class="bottomLabel" nowrap colspan="4">
										<div class="right">
											<button type="reset">重置</button>
											<button type="submit">查询</button>
										</div>
									</td>
							</table>
						</form>
					</jdf:form>
				</div>
				<div class="contentborder listArea">
					<div class="toolBar">
						<c:if test="${action=='page' }">
						    <input type="hidden" id="supplierId"/>
						    <a href="${dynamicDomain}/purchase/selectToSchedule?ajax=1&keepThis=true&TB_iframe=true&height=460&width=700" id="import" class="colorbox" style="display:none;">从采购单导入</a>
							<button type="button" onclick="javasctipt:$('#import').click();" style="width: 120px;">从采购单导入</button>
						</c:if>
					</div>
					<div id="tableDiv">
						<jdf:table items="items" var="currentRowObject" retrieveRowsCallback="limit" filterRowsCallback="limit" sortRowsCallback="limit" action="${action}">
							<jdf:export view="csv" fileName="排期表.csv" tooltip="Export CSV" imageName="csv" />
							<jdf:export view="xls" fileName="排期表.xls" tooltip="Export EXCEL" imageName="xls" />
							<jdf:row>
								<jdf:column property="purchaseId" title="采购编号" style="width: 15%">
								${currentRowObject.purchaseNo}
								</jdf:column>
								<jdf:column property="customerPurchaseNo" title="客人编号" style="width: 10%" />
								<jdf:column property="name" title="中文名称" style="width: 15%" />
								<jdf:column property="englishName" title="英文名称" style="width: 20%" />
								<jdf:column property="quantity" title="生产数量" style="width: 20%" viewsDenied="html"/>
								<jdf:column property="version" title="版本" style="width: 20%" viewsDenied="html"/>
								<jdf:column property="fileDate" title="来文件时间" style="width: 10%" cell="date"  viewsDenied="html"/>
								<jdf:column property="bluePaperDate" title="邮寄蓝纸时间" style="width: 10%" cell="date" viewsDenied="html"/>
								<jdf:column property="confirmProduceDate" title="确定生产时间" style="width: 10%" cell="date"  viewsDenied="html"/>
								<jdf:column property="sampleDate" title="大货样板提供时间" style="width: 10%" cell="date"  viewsDenied="html"/>
                                <jdf:column property="confirmSampleDate" title="样板OK日期" style="width: 5%" cell="date" viewsDenied="html"/>
                                <jdf:column property="boxMarkDate" title="箱唛" style="width: 5%" cell="date" viewsDenied="html"/>
                                <jdf:column property="piNo" title="P/I单号" style="width: 5%" viewsDenied="html"/>
                                <jdf:column property="closeDate" title="截仓日期" style="width: 5%" cell="date" viewsDenied="html"/>
								<jdf:column property="sendDate" title="走货日期" style="width: 13%" cell="date"/>
								 <c:if test="${action!='my' }">
								<jdf:column property="supplierId" title="生产工厂" style="width: 12%">
                                    <jdf:columnCollectionValue items="suppliers" nameProperty="name" value="${currentRowObject.supplierId}" />
                                </jdf:column>
                                </c:if>
                                <jdf:column property="progress" title="当前进度" style="width: 5%" viewsDenied="html"/>
                                <jdf:column property="remark" title="备注" style="width: 5%" viewsDenied="html"/>
								<jdf:column alias="操作" sortable="false" viewsAllowed="html" style="width: 15%">
									<c:if test="${action=='page'}">
										<a href="${dynamicDomain}/schedule/edit/${currentRowObject.id}?action=${action}" class="button">修改</a>
									</c:if>
									<a href="${dynamicDomain}/schedule/view/${currentRowObject.id}?action=${action}" class="button">查看</a>
									<c:if test="${action=='page'&&!currentRowObject.finished}">
                                        <a href="javascript:finish(${currentRowObject.objectId},'${action}')" class="button audit">走货完成</a>
                                    </c:if>
								</jdf:column>
							</jdf:row>
						</jdf:table>
					</div>
				</div>
			</div>
		</div>
	</div>
	<div style="display: none;">
        <div id="settingArea" class="contentborder">
            <form  id="settingForm">
	            <table class="inputTable">
                    <tr>
                        <td class="label cancelBorderLeft">
                            <label for="fileDate">来文件时间：</label>
                        </td>
                        <td class="content">
                            <input type="text" size="12" name="fileDate" class="Wdate" onClick="WdatePicker({dateFmt:'yyyy-MM-dd',readOnly:true})">
                        </td>
                        <td class="label">
                            <label for="bluePaperDate">邮寄蓝纸时间：</label>
                        </td>
                        <td class="content">
                            <input type="text" size="12" name="bluePaperDate" class="Wdate" onClick="WdatePicker({dateFmt:'yyyy-MM-dd',readOnly:true})">
                        </td>
                    </tr>
                    <tr>
                        <td class="label cancelBorderLeft">
                            <label for="confirmProduceDate">确定生产时间：</label>
                        </td>
                        <td class="content">
                            <input type="text" size="12" name="confirmProduceDate" class="Wdate" onClick="WdatePicker({dateFmt:'yyyy-MM-dd',readOnly:true})">
                        </td>
                        <td class="label">
                            <label for="sampleDate">样板提供时间：</label>
                        </td>
                        <td class="content">
                            <input type="text" size="12" name="sampleDate" class="Wdate" onClick="WdatePicker({dateFmt:'yyyy-MM-dd',readOnly:true})">
                        </td>
                    </tr>
                    <tr>
                        <td class="label cancelBorderLeft">
                            <label for="confirmSampleDate">样板OK时间：</label>
                        </td>
                        <td class="content">
                            <input type="text" size="12" name="confirmSampleDate" class="Wdate" onClick="WdatePicker({dateFmt:'yyyy-MM-dd',readOnly:true})">
                        </td>
                        <td class="label">
                            <label for="boxMarkDate">箱唛：</label>
                        </td>
                        <td class="content">
                            <input type="text" size="12" name="boxMarkDate" class="Wdate" onClick="WdatePicker({dateFmt:'yyyy-MM-dd',readOnly:true})">
                        </td>
                    </tr>
                    <tr>
                        <td class="label cancelBorderLeft">
                            <label for="closeDate">截仓时间：</label>
                        </td>
                        <td class="content">
                            <input type="text" size="12" name="closeDate" class="Wdate" onClick="WdatePicker({dateFmt:'yyyy-MM-dd',readOnly:true})">
                        </td>
                         <td class="label">
                            <label for="sendDate">走货时间：</label>
                        </td>
                        <td class="content">
                           <input type="text" id="sendDate" size="12" name="sendDate" class="Wdate" onClick="WdatePicker({dateFmt:'yyyy-MM-dd',readOnly:true})">
                        </td>
                    </tr>
	                <tr>
	                   <td class="bottomLabel" colspan="2">
	                      <div class="right">
	                          <button onclick="importSchedule()" id="payButton">确认导入</button>
	                      </div>
	                  </td>
	               </tr>
	            </table>
	          </form>
        </div>
    </div>
    
	<script type="text/javascript">
        $(function() {
        	$(".colorbox").colorbox({iframe:true, innerWidth:700, innerHeight:460});
        	$("#supplierId").colorbox({width: "45%", inline: true, href: "#settingArea" });  
        });
        
	</script>
</body>
</html>